<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<script type="text/javascript">
      function on_dept2_selected(node){
    	  $('#deptno').text(node.id);
    	  $('#mgrno').focus();
      }
    	
	  function on_doc_ready()
	  {
	    set_input_keydown_event();
	    $.extend($.fn.validatebox.defaults.rules, 
	    	{date:{message:'日期格式:YYYY-MM-DD',validator:validdate}});
	    $('#opcode').combobox({url:'fetchOpTypeList.action'});	
	    $('#log_panel').panel({onBeforeDestroy:function(){
	      $('#sel_dept_win').window('destroy',true);
	    }});	    
	  	$('#enddate').datebox({formatter:date_formater});
	  	$('#startdate').datebox({formatter:date_formater});
    	$('#startdate').keydown(function(e){
    		if (e.keyCode==13 || e.keyCode==9)
    			$(this).datebox('close');
    	});
    	$('#enddate').keydown(function(e){
    		if (e.keyCode==13 || e.keyCode==9)
    			$(this).datebox('close');
    	});

     	$('#selectdept').click(function (){
     	  $('#sel_dept_win').window('open');
    	});
	  	combobox_keypress('#opcode', '#termip');
	  	$('#query').click(query);
	  }
	  	  
	  function query()
	  {
	    var obj = {deptno:$('#deptno').text(),mgrno:$('#mgrno').val(),
	    	opterm:$('#termip').val(),opcode:$('#opcode').combobox('getValue'),
	    	startdate:$('#startdate').val(),enddate:$('#enddate').val()};
	    try{
	      $('#oplog_table').datagrid('load', obj);
	    }
	    catch (e){
	    	var fields = [
	      		{field:'logid',title:'日志ID',width:60,align:'center'},
	      		{field:'mgrno',title:'管理员号',width:60,align:'center'},
			    {field:'deptno',title:'机构号',width:60,align:'center'},
	      		{field:'opname',title:'操作',width:80,align:'center'},
	      		{field:'opdetail',title:'操作明细',width:250,align:'center'},
	      		{field:'opterm',title:'终端',width:100,align:'center'},
	      		{field:'opdate',title:'操作日期',width:80,align:'center'},
	      		{field:'optime',title:'操作时间',width:80,align:'center'}
	    	];
	    
	    	$('#oplog_table').datagrid({pageSize:12,pageList:[12],
	    		columns:[fields],pagination:true,striped:'true',
	    		url:'QueryOpLog.action',queryParams:obj,onLoadError:on_load_error});
	    	var pager=$('#oplog_table').datagrid('getPager');
	    	pager.pagination({showPageList:false});
	    }
	  }
	  
	  jQuery(document).ready(on_doc_ready);
	</script>
  </head>
  <body>
    <s:include value="../selectdept.jsp"></s:include>
    <div id="log_panel" title="管理日志查询" fit="true" iconCls="icon-save" 
    	closable="true" class="jquery_panel">
    <table width="100%" height="100%">
    	<tr>
    		<td height="60px">
  				<s:form action="QueryOpLog" cssStyle="padding:0;margin:0;" theme="simple" id="query_form">
				  	<table width="700px">
				  		<tr>
  							<td><label>查询机构:</label><label id="deptno"  
  								style="width:60px;height:18px" class="text_field_css"></label>
    							<label style="width:1px"></label>
    							<button id="selectdept" class="buttons_css" style="width:80px">
    							<label style="80px" class="infoclass">选择机构</label></button></td>
				  			<td><s:label value="管理员号:" for="mgrno"/><input id="mgrno" 
				  				maxlength=<s:property value="%{getText('MANAGER_WORKNO_LEN')}"/> 
				  				style="width:90px" class="text_field_css"></input></td>
				  			<td><s:label value="操作类型:"/><s:textfield id="opcode" editable="false"
				  				valueField="typeid" textField="typename" cssStyle="width:150px" 
				  				panelHeight="200"></s:textfield></td>
				  		</tr>
				  		<tr>
				  			<td><s:label value="操作终端:" for="termip"/><input id="termip" 
				  				maxlength=<s:property value="%{getText('IPADDR_LEN')}"/>
				  				class="text_field_css" style="width:144px"></input></td>
				  			<td><s:label value="开始日期:" for="startdate"/><input class="datebox text_field_css" 
				  				id="startdate" maxlength=10
				  				validType="date" style="width:90px"></input></td>
  							<td><s:label value="结束日期:" for="enddate"/><input class="datebox text_field_css" 
  								id="enddate" maxlength=10
  								validType="date" style="width:90px"></input><label style="width:1px"></label>
  								<button id="query" class="buttons_css" style="width:70px">
  									<label style="70px" class="infoclass">查询</label></button></td>
  						</tr>
  					</table>
  				</s:form>
    		</td>
    	</tr>
    	<tr>
    		<td width="100%">
				<table id="oplog_table" title="管理员管理日志" singleSelect="true" fit="true"
					fitColumns="true" style="background-color:white;"></table>
    		</td>
    	</tr>
    </table>
    </div>
  </body>
</html>
